home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm9_1_4
- Caption = "Colleges"
- ClientHeight = 1935
- ClientLeft = 1110
- ClientTop = 2445
- ClientWidth = 5055
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1935
- ScaleWidth = 5055
- Begin VB.PictureBox picResult
- Height = 495
- Left = 120
- ScaleHeight = 435
- ScaleWidth = 4755
- TabIndex = 7
- Top = 1320
- Width = 4815
- End
- Begin VB.CommandButton cmdProcess
- Caption = "Process College"
- Height = 375
- Left = 1680
- TabIndex = 6
- Top = 840
- Width = 1815
- End
- Begin VB.TextBox txtYear
- Height = 285
- Left = 4320
- TabIndex = 5
- Top = 480
- Width = 615
- End
- Begin VB.TextBox txtState
- Height = 285
- Left = 1680
- TabIndex = 3
- Top = 480
- Width = 375
- End
- Begin VB.TextBox txtCollege
- Height = 285
- Left = 1680
- TabIndex = 1
- Top = 120
- Width = 3255
- End
- Begin VB.Label lblYear
- Alignment = 1 'Right Justify
- Caption = "Year founded:"
- Height = 255
- Left = 3000
- TabIndex = 4
- Top = 480
- Width = 1215
- End
- Begin VB.Label lblState
- Alignment = 1 'Right Justify
- Caption = "State (abbrev.):"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 480
- Width = 1455
- End
- Begin VB.Label lblName
- Alignment = 1 'Right Justify
- Caption = "Name of College:"
- Height = 255
- Left = 0
- TabIndex = 0
- Top = 120
- Width = 1575
- End
- Attribute VB_Name = "frm9_1_4"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdProcess_Click()
- 'Demonstrate use of records
- picResult.Cls
- Dim college As collegeData
- Call GetDat(college)
- Call DisplayStatement(college)
- End Sub
- Private Sub DisplayStatement(school As collegeData)
- Dim centry As Integer, when As String
- century = 1 + Int(school.yearFounded / 100)
- picResult.Print RTrim(school.nom); " was founded in the" & Str(century);
- picResult.Print "th century in "; school.state
- Dim university As collegeData
- university.nom = "M.I.T."
- university.state = "MA"
- university.yearFounded = 1878
- If school.yearFounded < university.yearFounded Then
- when = "before "
- Else
- when = "after "
- End If
- picResult.Print RTrim(school.nom); " was founded ";
- picResult.Print when; RTrim(university.nom)
- End Sub
- Private Sub GetDat(school As collegeData)
- school.nom = txtCollege.Text
- school.state = txtState.Text
- school.yearFounded = Val(txtYear.Text)
- End Sub
-